import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";

import "lib-flexible";
import "normalize.css/normalize.css";

import { ConfigProvider } from "antd-mobile";
import zhCN from "antd-mobile/es/locales/zh-CN";

// 导入react-redux
import store from "./store";
import { Provider } from "react-redux";
// 处理最大宽度

(function () {
  function handlerMax() {
    const html = document.documentElement;
    const deviceW = html.clientWidth; //当前视图宽度
    const root = document.getElementById("root");
    root.style.maxWidth = "750px";
    if (deviceW >= 750) {
      html.style.fontSize = "75px";
    }
  }
  handlerMax();
  window.addEventListener("resize", handlerMax);
})();

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <Provider store={store}>
    <ConfigProvider locale={zhCN}>
      <App />
    </ConfigProvider>
  </Provider>
);
